import React, {Component} from 'react';

const detailData = [
    {id:"01",content:'学习Vue'},
    {id:"02",content:'学习React'},
    {id:"03",content: '学习Angular'}
]
export default  class Detail extends Component {
    render() {
        console.log('props',this.props)
        // params中id是字符串
        const {id,title} = this.props.match.params
        console.log('xxx',detailData)
        const  findResult = detailData.find(detailObj=>{
           
            return detailObj.id === id
        })
        console.log(findResult)
        return (
            <ul>
                <li>ID:{id}</li>
                <li>TiTLE:{title}</li>
                <li>CONTENT:{findResult.content}</li>

            </ul>
        );
    }
}


